<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <title>首页统计图表</title>
    <link href="/after/css/bootstrap.min.css?v=3.4.0" rel="stylesheet">
    <link href="/after/css/font-awesome.min.css?v=4.3.0" rel="stylesheet">
    <!-- Gritter -->
    <link href="/after/css/style.min.css?v=3.0.0" rel="stylesheet">

</head>

<body class="gray-bg">

<div class="wrapper wrapper-content" id="app">
    <div class="row">
        <div class="col-lg-3">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <span class="label label-success pull-right">今年</span>
                    <select class="label label-success pull-right" onchange="getMonthSal($(this).val())">
                        <option value="1">一月</option>
                        <option value="2">二月</option>
                        <option value="3">三月</option>
                        <option value="4">四月</option>
                        <option value="5">五月</option>
                        <option value="6">六月</option>
                        <option value="7">七月</option>
                        <option value="8">八月</option>
                        <option value="9">九月</option>
                        <option value="10">十月</option>
                        <option value="11">十一月</option>
                        <option value="12">十二月</option>
                    </select>
                    <h5>收入</h5>
                </div>
                <div class="ibox-content">
                    <h1 class="no-margins">{{monthSal}}</h1>
                    <div class="stat-percent font-bold text-success">98% <i class="fa fa-bolt"></i>
                    </div>
                    <small>环比</small>
                </div>
            </div>
        </div>
        <div class="col-lg-3">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <span class="label label-info pull-right">全年</span>
                    <h5>订单</h5>
                </div>
                <div class="ibox-content">
                    <h1 class="no-margins">{{dingdan}}</h1>
                    <div class="stat-percent font-bold text-info">20% <i class="fa fa-level-up"></i>
                    </div>
                    <small>同比</small>
                </div>
            </div>
        </div>
        <div class="col-lg-3">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <span class="label label-primary pull-right">年分</span>
                    <select class="label label-success pull-right" onchange="getYearSal($(this).val())">
                        <option value="2015">2015</option>
                        <option value="2016">2016</option>
                        <option value="2017">2017</option>
                        <option value="2018">2018</option>
                    </select>
                    <h5>收益</h5>
                </div>
                <div class="ibox-content">
                    <h1 class="no-margins">{{yearSal}}</h1>
                    <div class="stat-percent font-bold text-navy">44% <i class="fa fa-level-up"></i>
                    </div>
                    <small>环比</small>
                </div>
            </div>
        </div>
        <div class="col-lg-3">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <span class="label label-danger pull-right">注册用户总数</span>
                    <h5>活跃用户</h5>
                </div>
                <div class="ibox-content">
                    <h1 class="no-margins">${customNum}</h1>
                    <div class="stat-percent font-bold text-danger">38% <i class="fa fa-level-down"></i>
                    </div>
                    <small>同比</small>
                </div>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-lg-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>订单</h5>
                    <div class="pull-right">
                    </div>
                </div>
                <div class="ibox-content">
                    <div class="row">
                        <div class="col-lg-12" id="tubiao">

                        </div>
                    </div>
                </div>

            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-lg-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>订单</h5>
                    <div class="pull-right">
                        <div class="btn-group">
                            <button type="button" class="btn btn-xs btn-white active">天</button>
                            <button type="button" class="btn btn-xs btn-white">月</button>
                            <button type="button" class="btn btn-xs btn-white">年</button>
                        </div>
                    </div>
                </div>
                <div class="ibox-content">
                    <div class="row">
                        <div class="col-lg-9">
                            <div class="flot-chart">
                                <div class="flot-chart-content" id="flot-dashboard-chart"></div>
                            </div>
                        </div>
                        <div class="col-lg-3">
                            <ul class="stat-list">
                                <li>
                                    <h2 class="no-margins">2,346</h2>
                                    <small>订单总数</small>
                                    <div class="stat-percent">48% <i class="fa fa-level-up text-navy"></i>
                                    </div>
                                    <div class="progress progress-mini">
                                        <div style="width: 48%;" class="progress-bar"></div>
                                    </div>
                                </li>
                                <li>
                                    <h2 class="no-margins ">4,422</h2>
                                    <small>最近一个月订单</small>
                                    <div class="stat-percent">60% <i class="fa fa-level-down text-navy"></i>
                                    </div>
                                    <div class="progress progress-mini">
                                        <div style="width: 60%;" class="progress-bar"></div>
                                    </div>
                                </li>
                                <li>
                                    <h2 class="no-margins ">9,180</h2>
                                    <small>最近一个月销售额</small>
                                    <div class="stat-percent">22% <i class="fa fa-bolt text-navy"></i>
                                    </div>
                                    <div class="progress progress-mini">
                                        <div style="width: 22%;" class="progress-bar"></div>
                                    </div>
                                </li>
                        </div>
                    </div>
                </div>

            </div>
        </div>
    </div>
</div>

<!-- 全局js -->
<script src="/after/js/jquery-2.1.1.min.js"></script>
<script src="/after/js/bootstrap.min.js?v=3.4.0"></script>
<script src="/after/js/plugins/flot/jquery.flot.js"></script>
<script src="/after/js/content.min.js?v=1.0.0"></script>
<script src="/after/js/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script>
<script src="/after/js/plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script>
<script src="/after/js/plugins/easypiechart/jquery.easypiechart.js"></script>
<script src="/after/js/plugins/sparkline/jquery.sparkline.min.js"></script>
<script src="/after/js/vue/vue.min.js"></script>

<script>
    $(document).ready(function(){$(".chart").easyPieChart({barColor:"#f8ac59",scaleLength:5,lineWidth:4,size:80});$(".chart2").easyPieChart({barColor:"#1c84c6",scaleLength:5,lineWidth:4,size:80});var h=[[c(2012,1,1),7],[c(2012,1,2),6],[c(2012,1,3),4],[c(2012,1,4),8],[c(2012,1,5),9],[c(2012,1,6),7],[c(2012,1,7),5],[c(2012,1,8),4],[c(2012,1,9),7],[c(2012,1,10),8],[c(2012,1,11),9],[c(2012,1,12),6],[c(2012,1,13),4],[c(2012,1,14),5],[c(2012,1,15),11],[c(2012,1,16),8],[c(2012,1,17),8],[c(2012,1,18),11],[c(2012,1,19),11],[c(2012,1,20),6],[c(2012,1,21),6],[c(2012,1,22),8],[c(2012,1,23),11],[c(2012,1,24),13],[c(2012,1,25),7],[c(2012,1,26),9],[c(2012,1,27),9],[c(2012,1,28),8],[c(2012,1,29),5],[c(2012,1,30),8],[c(2012,1,31),25]];var g=[[c(2012,1,1),800],[c(2012,1,2),500],[c(2012,1,3),600],[c(2012,1,4),700],[c(2012,1,5),500],[c(2012,1,6),456],[c(2012,1,7),800],[c(2012,1,8),589],[c(2012,1,9),467],[c(2012,1,10),876],[c(2012,1,11),689],[c(2012,1,12),700],[c(2012,1,13),500],[c(2012,1,14),600],[c(2012,1,15),700],[c(2012,1,16),786],[c(2012,1,17),345],[c(2012,1,18),888],[c(2012,1,19),888],[c(2012,1,20),888],[c(2012,1,21),987],[c(2012,1,22),444],[c(2012,1,23),999],[c(2012,1,24),567],[c(2012,1,25),786],[c(2012,1,26),666],[c(2012,1,27),888],[c(2012,1,28),900],[c(2012,1,29),178],[c(2012,1,30),555],[c(2012,1,31),993]];var e=[{label:"订单数",data:g,color:"#1ab394",bars:{show:true,align:"center",barWidth:24*60*60*600,lineWidth:0}},{label:"付款数",data:h,yaxis:2,color:"#464f88",lines:{lineWidth:1,show:true,fill:true,fillColor:{colors:[{opacity:0.2},{opacity:0.2}]}},splines:{show:false,tension:0.6,lineWidth:1,fill:0.1},}];var a={xaxis:{mode:"time",tickSize:[3,"day"],tickLength:0,axisLabel:"Date",axisLabelUseCanvas:true,axisLabelFontSizePixels:12,axisLabelFontFamily:"Arial",axisLabelPadding:10,color:"#838383"},yaxes:[{position:"left",max:1070,color:"#838383",axisLabelUseCanvas:true,axisLabelFontSizePixels:12,axisLabelFontFamily:"Arial",axisLabelPadding:3},{position:"right",clolor:"#838383",axisLabelUseCanvas:true,axisLabelFontSizePixels:12,axisLabelFontFamily:" Arial",axisLabelPadding:67}],legend:{noColumns:1,labelBoxBorderColor:"#000000",position:"nw"},grid:{hoverable:false,borderWidth:0,color:"#838383"}};function c(j,k,i){return new Date(j,k-1,i).getTime()}var b=null,d=null;$.plot($("#flot-dashboard-chart"),e,a);var f={"US":298,"SA":200,"DE":220,"FR":540,"CN":120,"AU":760,"BR":550,"IN":200,"GB":120,};$("#world-map").vectorMap({map:"world_mill_en",backgroundColor:"transparent",regionStyle:{initial:{fill:"#e4e4e4","fill-opacity":0.9,stroke:"none","stroke-width":0,"stroke-opacity":0}},series:{regions:[{values:f,scale:["#1ab394","#22d6b1"],normalizeFunction:"polynomial"}]},})});
</script>


<!--统计代码，可删除-->

</body>
<script>
    var app = new Vue({
        el:'#app',
        data:{
            monthSal:[],//月销售额
            yearSal:[],//年销售额
            dingdan:[],//订单数量
            customNum:[]//新注册用户
        }
    })

    $(function(){
        getMonthSal(1);
        getYearSal(2018);
        ShowSales();
        $("#tubiao").load("/backstage/HJHSale1.ftl");
    })
//    查询某月收益
    var getMonthSal = function(obj){
        $.ajax({
            url:"/backIndex/getMonthSal.do",
            type:"post",
            dataType:"JSON",
            data : {
                month:obj
            },
            success:function (msg) {
                app.monthSal = msg;
            },error:function(){
                app.monthSal = "本月无收益";
            }
        });
    }
//    查询某年收益
    var getYearSal = function(obj){
        $.ajax({
            url:"/backIndex/getYearSal.do",
            type:"post",
            dataType:"JSON",
            data : {
                year:obj
            },
            success:function (msg) {
                app.yearSal = msg;
            },error:function(){
                app.yearSal = "当前年分无收益";
            }
        });
    }
    //查询订单总数
    var ShowSales = function() {
        $.ajax({
            url:"/show/ShowSales.do",
            type:"post",
            dataType:"JSON",
            data : {
            },
            error:function () {
                alert("错误");
            },
            success:function (msg) {
                app.dingdan = msg;
            }
        });
    }
</script>
</html>